import 'package:json_annotation/json_annotation.dart';

import 'comic_category_item_model.dart';

part 'comic_detail_model.g.dart';

@JsonSerializable()
class ComicDetailModel {
  final ComicItemModel? comic;
  final List<ComicChaptersModel>? comicChapters;
  final bool? isFavorite;
  final ComicPriceModel? buyPrice;
  final List<ComicItemModel>? similarComic;

  ComicDetailModel(this.comic, this.comicChapters, this.isFavorite,
      this.buyPrice, this.similarComic);

  factory ComicDetailModel.fromJson(Map<String, dynamic> json) =>
      _$ComicDetailModelFromJson(json);

  Map<String, dynamic> toJson() => _$ComicDetailModelToJson(this);
}

@JsonSerializable()
class ComicChaptersModel {
  final String? chapterTitle;
  final String? chapterId;
  final String? chapterNumber;
  final bool? isBuy;
  // final List<ComicItemModel>? similarComic;

  ComicChaptersModel(
      this.chapterTitle, this.chapterId, this.chapterNumber, this.isBuy);

  factory ComicChaptersModel.fromJson(Map<String, dynamic> json) =>
      _$ComicChaptersModelFromJson(json);

  Map<String, dynamic> toJson() => _$ComicChaptersModelToJson(this);
}

@JsonSerializable()
class ComicPriceModel {
  final int? chapterPrice;
  final int? comicPrice;
  // final List<ComicItemModel>? similarComic;

  ComicPriceModel(this.chapterPrice, this.comicPrice);

  factory ComicPriceModel.fromJson(Map<String, dynamic> json) =>
      _$ComicPriceModelFromJson(json);

  Map<String, dynamic> toJson() => _$ComicPriceModelToJson(this);
}
